home *** CD-ROM | disk | FTP | other *** search
- on leaveWisdomBg
- global gWisdomState
- put EMPTY into line 4 of gWisdomState
- end
-
- on LinkAWFromLine theLine
- global gWisdomRecs, gWisdomTitleRecs
- set fieldNum to the mouseCast
- if the timer < 20 then
- exit
- end if
- if theLine = -1 then
- resetCursor()
- exit
- end if
- if line theLine of field fieldNum = EMPTY then
- exit
- end if
- spinCursor()
- hilite line theLine of field fieldNum
- wait(10)
- hilite line 999 of field fieldNum
- set curRecord to value(item theLine of gWisdomTitleRecs)
- set theLine to ItemOffset(curRecord, gWisdomRecs)
- put curRecord && theLine
- LinkWisdomFromIcon(theLine)
- startMouse()
- end
-
- on LoadWisdomCat theCat
- global gResourcePath, gWisdomCategory, gWisdomRecs, gWisdomTitleRecs
- set gWisdomCategory to theCat
- set theLine to LineOffset(gWisdomCategory, field "ANWIS_CN")
- set gWisdomRecs to line value(theLine) of field "ANWIS_CD"
- set gWisdomTitleRecs to line value(theLine) of field "ANWIS_CT"
- LinkTo("W" & value(theLine))
- end
-
- on LinkBackToWisdomCat
- global gWisdomCategory
- leaveWisdomBg()
- LoadWisdomCat(gWisdomCategory)
- end
-
- on LinkWisdomFromIcon theSprite, theRecord
- global gWisdomCategory, gWisdomRecs, gWisdomTitleRecs, gIntroBack, gWisdomState, gResourcePath, gOnPC
- spinCursor()
- if not ((theRecord = EMPTY) or voidp(theRecord)) then
- set curRecord to theRecord
- set theSprite to 1
- set numRecs to 1
- else
- set numRecs to the number of items in gWisdomRecs
- set curRecord to value(item theSprite of gWisdomRecs)
- end if
- set theAB to line 4 of gWisdomState
- if not (theAB = 1) then
- set theAB to 1
- else
- set theAB to 0
- end if
- put curRecord & RETURN & theSprite & RETURN & numRecs & RETURN & theAB into line 1 to 4 of gWisdomState
- set sbTxtHdr to field "ANWIS_0"
- set numChunks to line 1 of sbTxtHdr
- delete line 1 of sbTxtHdr
- repeat with z = 1 to the number of lines in sbTxtHdr
- set sRec to word 1 of line z of sbTxtHdr
- set eRec to word 2 of line z of sbTxtHdr
- if (curRecord >= sRec) and (curRecord <= eRec) then
- exit repeat
- end if
- end repeat
- set theLine to curRecord - sRec + 1
- debug("R: " & curRecord)
- set theData to line theLine of field ("ANWIS_" & z)
- spinCursor()
- set the itemDelimiter to "|"
- set theCat to item 3 of theData
- set theTemplate to item 9 of theData
- set theImage to item 10 of theData
- if theTemplate = EMPTY then
- set theTemplate to "H"
- end if
- if theImage = EMPTY then
- set theImage to "STGMENU.PIC"
- end if
- set oldTemplate to line 5 of gWisdomState
- if theTemplate = "V" then
- set theCastName to "AWLNDSC.PIC" & theAB
- set wisFld to "Wisdom Text" & theAB
- else
- set theCastName to "AWPORTR.PIC" & theAB
- set wisFld to "Wisdom Text" & theAB & "V"
- end if
- if gOnPC then
- set the fileName of cast theCastName to gResourcePath & "WISPIC\" & theImage
- else
- set the fileName of cast theCastName to "STARGATE:RESOURCE:WISPIC:" & theImage
- end if
- put putBackChars(item 2 of theData) into field wisFld
- set theLine to LineOffset(gWisdomCategory, field "ANWIS_CN")
- spinCursor()
- set newFrame to "W" & theLine & " BG " & theTemplate & theAB
- if the frame <> label(newFrame) then
- LinkTo(newFrame)
- end if
- set the itemDelimiter to ","
- put theTemplate into line 5 of gWisdomState
- resetCursor()
- end
-
- on prevWisdom
- global gIntroBack, gWisdomState, gWisdomCategory
- set curItem to value(line 2 of gWisdomState)
- set maxItems to value(line 3 of gWisdomState)
- if curItem = EMPTY then
- set curItem to maxItems
- else
- if curItem = 1 then
- set curItem to maxItems
- else
- set curItem to curItem - 1
- end if
- end if
- LinkWisdomFromIcon(curItem)
- end
-
- on nextWisdom
- global gIntroBack, gWisdomState, gWisdomCategory
- set curItem to value(line 2 of gWisdomState)
- set maxItems to value(line 3 of gWisdomState)
- if curItem = EMPTY then
- set curItem to 1
- else
- if (curItem > maxItems) or (curItem = maxItems) then
- set curItem to 1
- else
- set curItem to curItem + 1
- end if
- end if
- LinkWisdomFromIcon(curItem)
- end
-